import java.util.Scanner;
public class Main{
    public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int T=sc.nextInt();
        while(T-->0){
            double y=sc.nextDouble();
            double l=0.0;
            double r=100.0;
            while(r-l>1e-5){
                double mid=(r+l)/2;
                if(2018*mid*mid*mid*mid+21*mid+5*mid*mid*mid+5*mid*mid+14>y){
                    r=mid;
                }else{
                    l=mid;
                }  
            }
            if(0==l||r==100){
                System.out.println(-1);
            }else{
                System.out.printf("%.4f\n",l);
            }
        }
    }
}
